
let p = new Promise((resolve, reject) => {
  resolve(new Promise((resolve, reject)=> {
    setTimeout(() => {
      resolve(200)
    }, 1000)
  }))
})

p.then(data => {
  console.log(data)
})

Promise.reject = function(value) {
  return new Promise((resolve, reject) => {
    reject(value)
  })
}

// Promise.resolve  Promise.reject 区别
// Promise.resolve这里可以接收一个promise
// Promise.reject接收promise不会有等待的效果

//  作业： Promise.finally实现

